home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILSTEM / DDOSAID.LZH / HERESTAT.ASM < prev    next >
Assembly Source File  |  1985-12-13  |  3KB  |  74 lines

  1.            PAGE    62,132
  2.            Title   DoubleDOS Utility: Current Partition Status
  3.  
  4. CR         EQU     0Dh                      ;ASCII Carriage Return
  5. LF         EQU     0Ah                      ;ASCII Line Feed
  6. $          EQU     24h                      ;String termination charachter
  7.  
  8. Dos_Call           EQU     21h
  9. Terminate_Process  EQU     4Ch
  10. Put_String         EQU     09h
  11. DD_Status          EQU     0E4h
  12.  
  13. Code_Seg   SEGMENT 
  14.            ASSUME  cs:Code_Seg,ds:Code_Seg,es:Code_Seg
  15.            ORG     0100h  
  16. Main       PROC    NEAR
  17.  
  18.            mov     ah,Put_String                 ;Display program info
  19.            mov     dx,OFFSET Prog_Info
  20.            int     Dos_Call
  21.  
  22.            mov     ah,DD_Status                  ;Get DoubleDOS status of
  23.            int     Dos_Call                      ;  the current partition
  24.            mov     Stat_Byte,al
  25.            mov     Task_Byte,ah
  26.            
  27.            or      al,00110000b                  ;convert binary integer
  28.            mov     Stat_Var,al                   ;  to ASCII and output
  29.            mov     ah,Put_String                 
  30.            mov     dx,OFFSET Stat_Prn            ;Output Status
  31.            int     Dos_Call
  32.  
  33.            mov     al,Stat_Byte
  34.            cmp     al,00h                        ;If DoubleDOS is not
  35.            jz      Skip_Task                     ;  running, skip task#
  36.  
  37.            mov     al,Task_Byte                  ;Convert binary integer
  38.            or      al,00110000b                  ;  to ASCII and output
  39.            mov     Task_Var,al
  40.            mov     ah,Put_String                 
  41.            mov     dx,OFFSET Task_Prn            ;Output Task Number
  42.            int     Dos_Call
  43.  
  44. Skip_Task: mov     ah,Put_String                 ;Errorlevel Message
  45.            mov     dx,OFFSET Finished
  46.            int     Dos_Call
  47.  
  48.            mov     al,Stat_Byte                  ;Errorlevel returned 
  49.            mov     ah,Terminate_Process          ;  in AL
  50.            int     Dos_Call
  51.  
  52. Stat_Byte  DB      ?
  53. Task_Byte  DB      ?
  54.  
  55. Prog_Info  DB      CR,LF,'DoubleDOS Utility - by Chris M. Magyar'
  56.            DB      ' - 12/13/85',CR,LF,CR,LF
  57.            DB      'Status : 0 - DoubleDOS not running.',CR,LF
  58.            DB      '         1 - Program is Visible.',CR,LF
  59.            DB      '         2 - Program is Invisible.',CR,LF,CR,LF,$
  60.  
  61. Stat_Prn   DB      'Current Partition Status : '
  62. Stat_Var   DB      ?,CR,LF,$
  63.  
  64.  
  65. Task_Prn   DB      'Current Task Number      : '
  66. Task_Var   DB      ?,CR,LF,$
  67.  
  68. Finished   DB      CR,LF,'Status is returned via ERRORLEVEL.',CR,LF,$
  69.  
  70. Main       ENDP
  71. Code_Seg   ENDS
  72.            END Main
  73.  
  74.